Is having 'Util' classes a cause for concern? [closed]

Posted by Matt Fenwick on Programmers See other posts from Programmers or by Matt Fenwick
Published on 2012-11-08T20:33:27Z Indexed on 2012/11/08 23:15 UTC
Read the original article Hit count: 232

I sometimes create 'Util' classes which primarily serve to hold methods and values that don't really seem to belong elsewhere. But every time I create one of these classes, I think "uh-oh, I'm gonna regret this later ...", because I read somewhere that it's bad.

But on the other hand, there seem to be two compelling (at least for me) cases for them:

  1. implementation secrets that are used in multiple classes within a package
  2. providing useful functionality to augment a class, without cluttering its interface

Am I on the way to destruction? What you say !! Should I refactor?

© Programmers or respective owner

Related posts about design

Related posts about object-oriented